package com.xxx.dit.service.impl;


import com.github.pagehelper.PageHelper;
import com.xxx.dit.domain.Dict;
import com.xxx.dit.domain.DictItem;
import com.xxx.dit.mapper.DictMapper;
import com.xxx.dit.query.DictQuery;
import com.xxx.dit.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictServiceImpl implements IDictService {
    @Autowired
    private DictMapper dictMapper;


    @Override
    public List<Dict> findAll() {
        return dictMapper.findAll();
    }

    @Override
    public Dict findOne(long id) {
        return dictMapper.findOne(id);
    }

    @Override
    public List<Dict> queryPage(DictQuery dictQuery) {
        PageHelper.startPage(dictQuery.getCurrentPage(), dictQuery.getPageSize());
        return dictMapper.queryPage(dictQuery);
    }

    @Override
    public void addDict(Dict dict) {
        dictMapper.addDict(dict);
    }

    @Override
    public void updateDict(Dict dict) {
        dictMapper.updateDict(dict);
    }

    @Override
    public void deleteDict(long id) {
        dictMapper.deleteDict(id);
    }

    @Override
    public void batchDicts(long[] ids) {
        dictMapper.batchDicts(ids);
    }


}
